#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>

using namespace std;

int main()
{
	int N;
	cin >> N;
	while (N--)
	{
		int X, Y;
		int sum = 0;
		cin >> X >> Y;
		if (X > Y)
		{
			swap(X, Y);
		}
		for (int i = X + 1; i < Y; i++)
		{
			if (i % 2 != 0)
			{
				sum += i;
			}
		}
		cout << sum << endl;
	}
	return 0;
}